"""
响应去重：
	数据存储之前去重
"""

import requests
import hashlib
import json

datas = []
figerprint_set = set()

for i in range(100):
	res = requests.get("https://yesno.wtf/api")
	data = res.json()
	figerprint = hashlib.md5(json.dumps(data).encode()).hexdigest()
	if figerprint in figerprint_set:
		pass
	else:
		figerprint_set.add(figerprint)
		datas.append(data)

print(f"获取去重以后的结果", len(datas))